package com.hundun.vision.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ：RuoChen
 * @date ：16:09 2024/11/29
 * @description：订单类型
 */
@AllArgsConstructor
@Getter
public enum OrderType {
    LIMIT("LIMIT", "限价单"),
    MARKET("MARKET", "市价单"),
    STOP("STOP", "止损限价单"),
    STOP_MARKET("STOP_MARKET", "止损市价单"),
    TAKE_PROFIT("TAKE_PROFIT", "止盈限价单"),
    TAKE_PROFIT_MARKET("TAKE_PROFIT_MARKET", "止盈市价单"),
    TRAILING_STOP_MARKET("TRAILING_STOP_MARKET", "跟踪止损单");

    private String type;

    private String description;

    public static String getDescription(String type) {
        for (OrderType orderType : OrderType.values()) {
            if (orderType.getType().equals(type)) {
                return orderType.getDescription();
            }
        }
        return null;
    }
}